| OLD | NEW |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/api-natives.h" | 5 #include "src/api-natives.h" |
| 6 #include "src/api.h" | 6 #include "src/api.h" |
| 7 #include "src/asmjs/asm-js.h" | 7 #include "src/asmjs/asm-js.h" |
| 8 #include "src/asmjs/asm-typer.h" | 8 #include "src/asmjs/asm-typer.h" |
| 9 #include "src/asmjs/asm-wasm-builder.h" | 9 #include "src/asmjs/asm-wasm-builder.h" |
| 10 #include "src/assert-scope.h" | 10 #include "src/assert-scope.h" |
| (...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 361 } | 361 } |
| 362 const int max_table_size = 1 << 26; | 362 const int max_table_size = 1 << 26; |
| 363 // The descriptor's 'initial'. | 363 // The descriptor's 'initial'. |
| 364 int initial; | 364 int initial; |
| 365 if (!GetIntegerProperty(isolate, &thrower, context, descriptor, | 365 if (!GetIntegerProperty(isolate, &thrower, context, descriptor, |
| 366 v8_str(isolate, "initial"), &initial, 0, | 366 v8_str(isolate, "initial"), &initial, 0, |
| 367 max_table_size)) { | 367 max_table_size)) { |
| 368 return; | 368 return; |
| 369 } | 369 } |
| 370 // The descriptor's 'maximum'. | 370 // The descriptor's 'maximum'. |
| 371 int maximum; | 371 int maximum = 0; |
| 372 Local<String> maximum_key = v8_str(isolate, "maximum"); | 372 Local<String> maximum_key = v8_str(isolate, "maximum"); |
| 373 Maybe<bool> has_maximum = descriptor->Has(context, maximum_key); | 373 Maybe<bool> has_maximum = descriptor->Has(context, maximum_key); |
| 374 | 374 |
| 375 if (has_maximum.IsNothing()) { | 375 if (has_maximum.IsNothing()) { |
| 376 // There has been an exception, just return. | 376 // There has been an exception, just return. |
| 377 return; | 377 return; |
| 378 } | 378 } |
| 379 if (has_maximum.FromJust()) { | 379 if (has_maximum.FromJust()) { |
| 380 if (!GetIntegerProperty(isolate, &thrower, context, descriptor, maximum_key, | 380 if (!GetIntegerProperty(isolate, &thrower, context, descriptor, maximum_key, |
| 381 &maximum, initial, max_table_size)) { | 381 &maximum, initial, max_table_size)) { |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 413 } | 413 } |
| 414 Local<Context> context = isolate->GetCurrentContext(); | 414 Local<Context> context = isolate->GetCurrentContext(); |
| 415 Local<v8::Object> descriptor = args[0]->ToObject(context).ToLocalChecked(); | 415 Local<v8::Object> descriptor = args[0]->ToObject(context).ToLocalChecked(); |
| 416 // The descriptor's 'initial'. | 416 // The descriptor's 'initial'. |
| 417 int initial; | 417 int initial; |
| 418 if (!GetIntegerProperty(isolate, &thrower, context, descriptor, | 418 if (!GetIntegerProperty(isolate, &thrower, context, descriptor, |
| 419 v8_str(isolate, "initial"), &initial, 0, 65536)) { | 419 v8_str(isolate, "initial"), &initial, 0, 65536)) { |
| 420 return; | 420 return; |
| 421 } | 421 } |
| 422 // The descriptor's 'maximum'. | 422 // The descriptor's 'maximum'. |
| 423 int maximum; | 423 int maximum = 0; |
| 424 Local<String> maximum_key = v8_str(isolate, "maximum"); | 424 Local<String> maximum_key = v8_str(isolate, "maximum"); |
| 425 Maybe<bool> has_maximum = descriptor->Has(context, maximum_key); | 425 Maybe<bool> has_maximum = descriptor->Has(context, maximum_key); |
| 426 | 426 |
| 427 if (has_maximum.IsNothing()) { | 427 if (has_maximum.IsNothing()) { |
| 428 // There has been an exception, just return. | 428 // There has been an exception, just return. |
| 429 return; | 429 return; |
| 430 } | 430 } |
| 431 if (has_maximum.FromJust()) { | 431 if (has_maximum.FromJust()) { |
| 432 if (!GetIntegerProperty(isolate, &thrower, context, descriptor, maximum_key, | 432 if (!GetIntegerProperty(isolate, &thrower, context, descriptor, maximum_key, |
| 433 &maximum, initial, 65536)) { | 433 &maximum, initial, 65536)) { |
| (...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 686 int unused_property_fields = in_object_properties - pre_allocated; | 686 int unused_property_fields = in_object_properties - pre_allocated; |
| 687 Handle<Map> map = Map::CopyInitialMap( | 687 Handle<Map> map = Map::CopyInitialMap( |
| 688 prev_map, instance_size, in_object_properties, unused_property_fields); | 688 prev_map, instance_size, in_object_properties, unused_property_fields); |
| 689 | 689 |
| 690 context->set_wasm_function_map(*map); | 690 context->set_wasm_function_map(*map); |
| 691 } | 691 } |
| 692 } | 692 } |
| 693 | 693 |
| 694 } // namespace internal | 694 } // namespace internal |
| 695 } // namespace v8 | 695 } // namespace v8 |
| OLD | NEW |