summaryrefslogtreecommitdiff
path: root/deps/v8/test/cctest/test-inobject-slack-tracking.cc
diff options
context:
space:
mode:
authorMichaël Zasso <targos@protonmail.com>2019-03-12 09:01:49 +0100
committerMichaël Zasso <targos@protonmail.com>2019-03-14 18:49:21 +0100
commit7b48713334469818661fe276cf571de9c7899f2d (patch)
tree4dbda49ac88db76ce09dc330a0cb587e68e139ba /deps/v8/test/cctest/test-inobject-slack-tracking.cc
parent8549ac09b256666cf5275224ec58fab9939ff32e (diff)
downloadnode-new-7b48713334469818661fe276cf571de9c7899f2d.tar.gz
deps: update V8 to 7.3.492.25
PR-URL: https://github.com/nodejs/node/pull/25852 Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
Diffstat (limited to 'deps/v8/test/cctest/test-inobject-slack-tracking.cc')
-rw-r--r--deps/v8/test/cctest/test-inobject-slack-tracking.cc26
1 files changed, 11 insertions, 15 deletions
diff --git a/deps/v8/test/cctest/test-inobject-slack-tracking.cc b/deps/v8/test/cctest/test-inobject-slack-tracking.cc
index 9255dc04b0..61984afe23 100644
--- a/deps/v8/test/cctest/test-inobject-slack-tracking.cc
+++ b/deps/v8/test/cctest/test-inobject-slack-tracking.cc
@@ -8,7 +8,7 @@
#include "src/api-inl.h"
#include "src/objects-inl.h"
-#include "src/objects.h"
+#include "src/objects/heap-number-inl.h"
#include "src/v8.h"
#include "test/cctest/cctest.h"
@@ -49,10 +49,11 @@ Handle<T> GetLexical(const char* name) {
ScriptContextTable::LookupResult lookup_result;
if (ScriptContextTable::Lookup(isolate, script_contexts, str_name,
&lookup_result)) {
- Handle<Object> result = FixedArray::get(
- *ScriptContextTable::GetContext(isolate, script_contexts,
- lookup_result.context_index),
- lookup_result.slot_index, isolate);
+ Handle<Context> script_context = ScriptContextTable::GetContext(
+ isolate, script_contexts, lookup_result.context_index);
+
+ Handle<Object> result(script_context->get(lookup_result.slot_index),
+ isolate);
return Handle<T>::cast(result);
}
return Handle<T>();
@@ -74,31 +75,27 @@ static inline Handle<T> CompileRunI(const char* script) {
return OpenHandle<T>(CompileRun(script));
}
-
-static Object* GetFieldValue(JSObject* obj, int property_index) {
+static Object GetFieldValue(JSObject obj, int property_index) {
FieldIndex index = FieldIndex::ForPropertyIndex(obj->map(), property_index);
return obj->RawFastPropertyAt(index);
}
-
-static double GetDoubleFieldValue(JSObject* obj, FieldIndex field_index) {
+static double GetDoubleFieldValue(JSObject obj, FieldIndex field_index) {
if (obj->IsUnboxedDoubleField(field_index)) {
return obj->RawFastDoublePropertyAt(field_index);
} else {
- Object* value = obj->RawFastPropertyAt(field_index);
+ Object value = obj->RawFastPropertyAt(field_index);
CHECK(value->IsMutableHeapNumber());
return MutableHeapNumber::cast(value)->value();
}
}
-
-static double GetDoubleFieldValue(JSObject* obj, int property_index) {
+static double GetDoubleFieldValue(JSObject obj, int property_index) {
FieldIndex index = FieldIndex::ForPropertyIndex(obj->map(), property_index);
return GetDoubleFieldValue(obj, index);
}
-
-bool IsObjectShrinkable(JSObject* obj) {
+bool IsObjectShrinkable(JSObject obj) {
Handle<Map> filler_map =
CcTest::i_isolate()->factory()->one_pointer_filler_map();
@@ -114,7 +111,6 @@ bool IsObjectShrinkable(JSObject* obj) {
return true;
}
-
TEST(JSObjectBasic) {
// Avoid eventual completion of in-object slack tracking.
FLAG_always_opt = false;